package com.example.android;

import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

public class DetailActivity extends AppCompatActivity {

    private TextView priceTv;
    private TextView desTv;
    private TextView nameTv;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.detail_activity_layout);
        initView();
        initData();
        initEvent();
    }
private void initView(){
    nameTv = findViewById(R.id.name_Tv);
    desTv = findViewById(R.id.des_Tv);
    priceTv = findViewById(R.id.price_Tv);
}
private void initData(){
    Intent intent = getIntent();
    String nameStr = intent.getStringExtra("name");
    String desStr = intent.getStringExtra("des");
    String priceStr = intent.getStringExtra("price");
    nameTv.setText(nameStr);
    desTv.setText(desStr);
    priceTv.setText(priceStr);
}
private void initEvent(){

}
}
